/*
 * Copyright 2011 Drew Wilder-Goodwin
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */
#ifndef MAIN_DIALOG_H
#define MAIN_DIALOG_H

#include "resources.h"
#include "tab.h"
#include <windows.h>

/* Main dialog */
#define DLG_MAIN (DLG_MAIN_START+0)
#define DLG_MAIN_TAB (DLG_MAIN_START+1)
#define DLG_MAIN_HELP_BUTTON (DLG_MAIN_START+2)
#define DLG_MAIN_NEXT_BUTTON (DLG_MAIN_START+3)
#define DLG_MAIN_SAVE_BUTTON (DLG_MAIN_START+4)
#define DLG_MAIN_EXIT_BUTTON (DLG_MAIN_START+5)

/* Main dialog buttons text */
#define STRING_DLG_MAIN_HELP (DLG_MAIN_START+6)
#define STRING_DLG_MAIN_NEXT (DLG_MAIN_START+7)
#define STRING_DLG_MAIN_SAVE (DLG_MAIN_START+8)
#define STRING_DLG_MAIN_EXIT (DLG_MAIN_START+9)

/* Main dialog tabs text */
#define STRING_TAB_SYSTEM (DLG_MAIN_START+10)
#define STRING_TAB_DIRECTX (DLG_MAIN_START+11)
#define STRING_TAB_DISPLAY (DLG_MAIN_START+12)
#define STRING_TAB_SOUND (DLG_MAIN_START+13)
#define STRING_TAB_MUSIC (DLG_MAIN_START+14)
#define STRING_TAB_INPUT (DLG_MAIN_START+15)
#define STRING_TAB_NETWORK (DLG_MAIN_START+16)
#define STRING_TAB_HELP (DLG_MAIN_START+17)

/* Main dialog tab indices */
enum TAB_ENUM {
    TAB_SYSTEM = 0,
    TAB_DIRECTX,
    TAB_DISPLAY,
    TAB_SOUND,
    TAB_MUSIC,
    TAB_INPUT,
    TAB_NETWORK,
    TAB_HELP,
    TAB_COUNT
};

/* Main dialog constants */
#define WND_DEF_SPACING 7
#define WND_WIDTH 500
#define WND_HEIGHT 300
#define BUTTON_DEF_HEIGHT 14
#define DLG_UNIT_DEF_HEIGHT 8
#define DLG_UNIT_DEF_WIDTH 4
#define DLG_MAIN_BUTTON_WIDTH 80

/* Main dialog layout */
#define DLG_MAIN_TAB_HEIGHT (WND_HEIGHT-3*WND_DEF_SPACING-BUTTON_DEF_HEIGHT)
#define DLG_MAIN_EXIT_LEFT (WND_WIDTH-WND_DEF_SPACING-DLG_MAIN_BUTTON_WIDTH)
#define DLG_MAIN_SAVE_LEFT (DLG_MAIN_EXIT_LEFT-DLG_MAIN_BUTTON_WIDTH-WND_DEF_SPACING)
#define DLG_MAIN_NEXT_LEFT (DLG_MAIN_SAVE_LEFT-DLG_MAIN_BUTTON_WIDTH-WND_DEF_SPACING)
#define DLG_MAIN_TAB_WIDTH (WND_WIDTH-2*WND_DEF_SPACING)
#define DLG_MAIN_BUTTON_TOP (DLG_MAIN_TAB_HEIGHT+2*WND_DEF_SPACING)
#define TAB_TOP (WND_DEF_SPACING*2+DLG_UNIT_DEF_HEIGHT)
#define TAB_LEFT (WND_DEF_SPACING*2)
#define TAB_HEIGHT (DLG_MAIN_TAB_HEIGHT-TAB_TOP)
#define TAB_WIDTH (DLG_MAIN_TAB_WIDTH-2*WND_DEF_SPACING)

/* Main dialog functions */
void set_default_window_size(HWND hwnd);
void resize_main_dialog(HWND hDialog, LONG width, LONG height);
void create_main_dialog(HWND hwnd);
RECT get_tabcontrol_displayarea(void);

#define MAX_FILENAME 1024

#endif
